CC = gcc
CFLAGS = -Wall -O2
LIBS = -lssl -lcrypto

TARGETS = generate_keys alice bob
SOURCES = generate_keys.c alice.c bob.c crypto_utils.c
HEADERS = common.h crypto_utils.h

all: $(TARGETS)

generate_keys: generate_keys.c crypto_utils.c $(HEADERS)
	$(CC) $(CFLAGS) -o generate_keys generate_keys.c crypto_utils.c $(LIBS)

alice: alice.c crypto_utils.c $(HEADERS)
	$(CC) $(CFLAGS) -o alice alice.c crypto_utils.c $(LIBS)

bob: bob.c crypto_utils.c $(HEADERS)
	$(CC) $(CFLAGS) -o bob bob.c crypto_utils.c $(LIBS)

clean:
	rm -f $(TARGETS) *.pem envelope.dat decrypted.txt plain.txt

.PHONY: all clean
